import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import Login from '../components/Login.vue'
import CustomManager from '../components/CustomManager.vue'
import ClassManager from '../components/ClassManager.vue'
import CoachManager from '../components/CoachManager.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
        children: [
            {
                path: '/custom',
                name: '客户管理',
                component: CustomManager
            },{
                path: '/class',
                name: '课程管理',
                component: ClassManager
            },{
                path: '/coach',
                name: '教练管理',
                component: CoachManager
            }
        ]
    },
    {
        path: '/login',
        name: '登录',
        component: Login
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
